<%@ page contentType="text/html;charset=UTF-8" session="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<link rel="stylesheet"
	href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet"
	href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/starter-template.css">
<script
	src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<head>
	<title>BLOG::SEASON2</title>
</head>
<body>
	<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
		<div class="container">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed"
					data-toggle="collapse" data-target=".navbar-collapse">
					<span class="sr-only">Toggle navigation</span> <span
						class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="#">BLOG::Season2</a>
			</div>
			<div class="collapse navbar-collapse">
				<ul class="nav navbar-nav">
					<li class="active"><a href="#">Home</a></li>
					<li><a href="<%=request.getContextPath()%>/findBlogs">Blog</a></li>
					<!-- 					<li><a href="#contact">Contact</a></li> -->
				</ul>
			</div>
			<!--/.nav-collapse -->
		</div>
	</nav>
	<div align="center">
		<h1>블로그 리스트</h1>
		<c:forEach var="blog" items="${blogList}">
		 	<table cellpadding="3" cellspacing="0" border="0" width="400">
		 		<tr>
			   		<td align="left">::&nbsp;<b>${blog.title}</b></td>
		        	<td align="right" width='100'>no.${blog.id}</td>
	        	</tr>
	        	<tr>
			    	<td align="left"><i>written by</i> ${blog.writer}</td>
			    	<td align="right" width='100'><i>Date: </i>${blog.regDate} </td>
			    </tr>
			    <tr>
			    	<td colspan="2">
			    		<pre>${blog.description}</pre>
			    	</td>
		    	</tr>
		    	<tr>
			    	<td align="right" colspan="2">
			    		<a href="<%= request.getContextPath() %>/editBlog.do?blogId=${blog.id}">수정</a>
			    		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			    		<a href="<%= request.getContextPath() %>/deleteBlog.do?blogId=${blog.id}">삭제</a>
			    	</td>
			    </tr>
			    <tr>
			    	<td colspan="2"><hr></td>
			    </tr>
		 	</table>
		</c:forEach>
		
		<a href="<%= request.getContextPath() %>/createBlog.do">새글</a>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<a href="<%= request.getContextPath() %>/findBlogs.do">전체목록</a>
	</div>
</body>
</html>
